<?php
/**
 * @author SeveNs 
 * @copyright 2017@DivCSS.com
 * @contact QQ:2015969
 * @file(:config.inc.php)
 */
// 检查常量是否已定义
if (!defined("Site_Name")) define("Site_Name","Project-D");
if (!defined("Site_Url")) define("Site_Url","http://127.0.0.2");
if (!defined("Site_Lang")) define("Site_Lang","utf8");
if (!defined("Site_Db")) define("Site_Db","localhost");
if (!defined("Site_Dbuser")) define("Site_Dbuser","ydd");
if (!defined("Site_Dbpass")) define("Site_Dbpass","aBs22t7d2KAZiajt");
if (!defined("Site_Dbname")) define("Site_Dbname","ydd");
if (!defined("Site_Adminname")) define("Site_Adminname","admin");
define("PEPPER", "2f4d9a8b7c1e3d5f6a9b8c7d0e1f2a3"); // 随机密钥(32+字符)
define("TOKEN_EXPIRE", 3600 * 12); // Token有效期12小时

// 加密配置
define("PASSWORD_ALGO", PASSWORD_BCRYPT); // 使用BCRYPT确保兼容性
define("PASSWORD_OPTIONS", ['cost' => 10]); // 适中的计算成本
try {
    $conn = new PDO(
        'mysql:host='.Site_Db.';dbname='.Site_Dbname,
        Site_Dbuser, 
        Site_Dbpass,
        array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
    );
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {  
    die("数据库连接失败: " . $e->getMessage());  
}
?>